package com.gxa.community.admin.mapper.user;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gxa.community.core.pojo.bo.UserBo;
import com.gxa.community.core.pojo.domain.OrderInfo;
import com.gxa.community.core.pojo.domain.UserInfo;
import com.gxa.community.core.pojo.domain.UserShippingAddress;
import com.gxa.community.core.pojo.dto.userdto.UserDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author juran
 * @since 2022-07-18
 */
@Mapper
public interface UserMapper extends BaseMapper<UserInfo> {

    /**
     * 查询用户信息
     *
     * @return
     */
    UserBo queryUserInfo(@Param("userId") Integer userId);

    /**
     * 查询用户标签
     *
     * @param userId
     * @return
     */
    List<String> queryUserTags(@Param("userId") Integer userId);

    /**
     * 查询过用户收获地址
     *
     * @param userId
     * @return
     */
    List<UserShippingAddress> queryUserShippingAddress(@Param("userId") Integer userId);

    /**
     * 查询用户订单信息
     *
     * @param userId
     * @return
     */
    List<OrderInfo> queryUserOrderInfo(@Param("userId")Integer userId);

    /**
     * 批量设置用户标签
     *
     * 删除选中用户标签
     * 设置用户标签
     */
    int delUserTags(@Param("userDto") UserDto userDto);
    int addUserTags(@Param("userDto") UserDto userDto);
}
